#! /usr/bin/env python

# Copyright (c) 2011, Markus Achtelik, ASL, ETH Zurich, Switzerland
# You can contact the author at <markus dot achtelik at mavt dot ethz dot ch>
# 
# All rights reserved.
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of ETHZ-ASL nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
# 
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ETHZ-ASL BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

PACKAGE='asctec_hl_interface'

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

# @todo Think about levels. Setting most of these to STOP to guarantee atomicity.
# @todo Double check these ranges, defaults

defMin = -100
defMax = 100

SEND_PARAMETERS     = gen.const("SEND_PARAMETERS",          int_t, 0x00000001, "send_parameters")
PARAMETER_CHANGED   = gen.const("PARAMETER_CHANGED",        int_t, 0x00000002, "parameter_changed")
TF_CHANGED          = gen.const("TF_CHANGED",               int_t, 0x00000004, "listen_tf_changed")

#       Name                 Type      Reconfiguration level                Description   Default   Min   Max
gen.add("listen_on_tf",      bool_t,   TF_CHANGED["value"],                     "Enables listening on tf transforms for position updates for the state estimation on the HLP.", True)
gen.add("tf_ref_frame_id",   str_t,    TF_CHANGED["value"],                     "tf reference frame."             , "world")
gen.add("tf_tracked_frame_id",str_t,   TF_CHANGED["value"],                     "tf frame of the helicopter."     , "mav")
gen.add("send",              bool_t,   SEND_PARAMETERS["value"],                "used to send all parameters at once.", False)
gen.add("omega_0_xy",        double_t, PARAMETER_CHANGED["value"],              "natural frequency of the position controller's reference model for x and y axis.", 2.5,    defMin,   defMax)
gen.add("omega_0_z",         double_t, PARAMETER_CHANGED["value"],              "natural frequency of the position controller's reference model for the z axis.",   8.0,    defMin,   defMax)
gen.add("zeta_xy",           double_t, PARAMETER_CHANGED["value"],              "damping of the position controller's reference model for x and y axis.",           1.0,    defMin,   defMax)
gen.add("zeta_z",            double_t, PARAMETER_CHANGED["value"],              "damping of the position controller's reference model for the z axis.",             1.0,    defMin,   defMax)
gen.add("p1",                double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p2",                double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p3",                double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p4",                double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p5",                double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p6",                double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p7",                double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p8",                double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p9",                double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p10",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p11",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p12",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p13",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p14",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p15",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p16",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p17",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p18",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p19",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p20",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p21",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p22",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p23",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p24",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p25",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p26",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p27",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p28",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p29",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p30",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p31",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p32",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p33",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p34",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p35",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p36",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p37",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p38",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p39",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p40",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p41",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p42",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p43",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p44",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p45",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p46",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p47",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p48",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p49",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)
gen.add("p50",               double_t, PARAMETER_CHANGED["value"],              " ",                    0.,     defMin,   defMax)

exit(gen.generate(PACKAGE, "Config", "SSDK"))
